<?php

/**
 * Pitanje form base class.
 *
 * @package    marketing
 * @subpackage form
 * @author     Your name here
 */
class BasePitanjeForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'            => new sfWidgetFormInputHidden(),
      'tekst_pitanja' => new sfWidgetFormInput(),
      'upitnik_id'    => new sfWidgetFormPropelChoice(array('model' => 'Upitnik', 'add_empty' => false)),
      'created_at'    => new sfWidgetFormDateTime(),
      'updated_at'    => new sfWidgetFormDateTime(),
      'deleted_at'    => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'            => new sfValidatorPropelChoice(array('model' => 'Pitanje', 'column' => 'id', 'required' => false)),
      'tekst_pitanja' => new sfValidatorString(array('max_length' => 45)),
      'upitnik_id'    => new sfValidatorPropelChoice(array('model' => 'Upitnik', 'column' => 'id')),
      'created_at'    => new sfValidatorDateTime(array('required' => false)),
      'updated_at'    => new sfValidatorDateTime(array('required' => false)),
      'deleted_at'    => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('pitanje[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Pitanje';
  }


}
